package com.example.springbootdatamock.bean;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;


@Document(indexName = "di")
public class Customer {

    @Id
    private Integer id;

    @Field(type = FieldType.Keyword)
    private String name;


    public void setId(Integer id) {
        this.id = id;
    }

    @Field(type = FieldType.Keyword)
    private String sex;
    @Field(type = FieldType.Keyword)
    private String source;
    @Field(type = FieldType.Keyword)
    private String profession;

    public void setName(String name) {
        this.name = name;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public void setProfession(String profession) {
        this.profession = profession;
    }

    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof Customer)) return false;
        Customer other = (Customer) o;
        if (!other.canEqual(this)) return false;
        Object this$id = getId(), other$id = other.getId();
        if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id)) return false;
        Object this$name = getName(), other$name = other.getName();
        if ((this$name == null) ? (other$name != null) : !this$name.equals(other$name)) return false;
        Object this$sex = getSex(), other$sex = other.getSex();
        if ((this$sex == null) ? (other$sex != null) : !this$sex.equals(other$sex)) return false;
        Object this$source = getSource(), other$source = other.getSource();
        if ((this$source == null) ? (other$source != null) : !this$source.equals(other$source)) return false;
        Object this$profession = getProfession(), other$profession = other.getProfession();
        return !((this$profession == null) ? (other$profession != null) : !this$profession.equals(other$profession));
    }

    protected boolean canEqual(Object other) {
        return other instanceof Customer;
    }

    public int hashCode() {
        int result = 1;
        int PRIME = 59;
        result = 1;
        Object $id = getId();
        result = result * 59 + (($id == null) ? 43 : $id.hashCode());
        Object $name = getName();
        result = result * 59 + (($name == null) ? 43 : $name.hashCode());
        Object $sex = getSex();
        result = result * 59 + (($sex == null) ? 43 : $sex.hashCode());
        Object $source = getSource();
        result = result * 59 + (($source == null) ? 43 : $source.hashCode());
        Object $profession = getProfession();
        return result * 59 + (($profession == null) ? 43 : $profession.hashCode());
    }

    public String toString() {
        return "Customer(id=" + getId() + ", name=" + getName() + ", sex=" + getSex() + ", source=" + getSource() + ", profession=" + getProfession() + ")";
    }


    public Customer() {
    }

    public Customer(Integer id, String name, String sex, String source, String profession) {

        this.id = id;
        this.name = name;
        this.sex = sex;
        this.source = source;
        this.profession = profession;

    }


    public Integer getId() {

        return this.id;

    }

    public String getName() {

        return this.name;

    }

    public String getSex() {

        return this.sex;

    }

    public String getSource() {

        return this.source;

    }

    public String getProfession() {

        return this.profession;

    }

}



